<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>警告框</title>
    <link href="../../../css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
    <div class="alert alert-info fade in"id="myalert">
        <button type="button" class="close" data-dismiss="alert">&times;</button>
        <strong>dfghjk</strong>fghjkl
    </div>
    <div class="alert alert-info fade in"id="myalert1">
        <button type="button" class="close" data-dismiss="alert">&times;</button>
        <strong>dfghjk</strong>fghjkl
        <button type="button" class="btn btn-primary" data-dismiss="alert">详情</button>
    </div>
</div>
<script src="../../../js/jquery-2.1.1.js"></script>
<script src="../../../js/bootstrap.js"></script>
<script>
    $("#myalert").alert("close");
    $("#myalert1").on("close.bs.alert",function(e){
        console.log("触发了");
    })
</script>
</body>
</html>